<template>
  <div class="home">
    <el-form ref="homeForm"  class="home-form">
      <h3 class="title">基于人脸识别的家谱管理系统</h3>

      <el-form-item style="width:100%;">
        <el-row>
          <el-button
            :loading="loading"
            size="medium"
            type="primary"
            style="width:100%;"
            @click.native.prevent="handleLoginByFace"
          >
            <span v-if="!loading">人脸登录</span>
            <span v-else>登 录 中...</span>
          </el-button>
        </el-row>
        <el-row>
          <el-button
            :loading="loading"
            size="medium"
            type="primary"
            style="width:100%;margin-top: 10px"
            @click.native.prevent="handleLogin"
          >
            <span v-if="!loading">账号密码登录</span>
            <span v-else>登 录 中...</span>
          </el-button>
        </el-row>
        <div style="float: right;">
          <router-link class="link-type" :to="'/login'">使用已有账户登录</router-link>
        </div>

      </el-form-item>
    </el-form>
  </div>
</template>

<script>

export default {
  name: "Home",

  created() {

  },
  methods: {
    handleLoginByFace(){
      this.$router.push('/loginByFace');
    },
    handleLogin() {
      this.$router.push('/login');
    }
  }
};
</script>

<style rel="stylesheet/scss" lang="scss">
.home {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  background-image: url("../assets/images/login-background.jpg");
  background-size: cover;
}
.title {
  margin: 0px auto 30px auto;
  text-align: center;
  color: #707070;
}

.home-form {
  border-radius: 6px;
  background: #ffffff;
  width: 400px;
  padding: 25px 25px 5px 25px;

  .el-input {
    height: 38px;

    input {
      height: 38px;
    }
  }
}
</style>
